package com.bsoft.hospitalchs.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bsoft.hospitalchs.R;
import com.bsoft.hospitalchs.model.Binner;
import com.bumptech.glide.Glide;


public class NetworkImageHolderView implements Holder<Binner> {
    private ImageView imageView;
    @Override
    public View createView(Context context) {
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }

    @Override
    public void UpdateUI(Context context, int i, Binner binner) {
        imageView.setImageResource(R.mipmap.ic_launcher);
        Glide.with(context).load(binner.getDrawableId()).error(R.mipmap.ic_launcher).into(imageView);
    }
}
